//
//  BundleManager.m
//  EUCIOS
//
//  Created by Khang on 3/29/13.
//  Copyright (c) 2013 Khang. All rights reserved.
//

#import "BundleManager.h"

static BundleManager* gBundleManager = nil;

@implementation BundleManager

- (id)init {
    if (self = [super init]) {
        
    }
    return self;
}

+ (id)sharedBundleManager {
    if (!gBundleManager) {
        gBundleManager = [[BundleManager alloc] init];
    }
    return gBundleManager;
}

#pragma mark -
#pragma mark Public
- (UIImage*)getBundleImage:(NSString*)name fromBundle:(NSString*)bundlename {
    NSString* bundle = bundlename;
    if ([bundle rangeOfString:@".bundle"].location == NSNotFound) {
        bundle = [bundle stringByAppendingString:@".bundle"];
    }
    
    NSString* path = [NSString stringWithFormat:@"%@/%@", bundle, name];
    return [UIImage imageNamed:path];
}

@end
